<template>
  <div class="ma-content-block lg:flex justify-between p-4">
    <!-- CRUD 组件 -->
    <ma-crud :options="options" :columns="columns" ref="crudRef">
    </ma-crud>
  </div>
</template>
<script setup>
import { ref, reactive } from 'vue'
import backendStaff from '@/api/backend/backendStaff'
import { Message } from '@arco-design/web-vue'
import tool from '@/utils/tool'
import * as common from '@/utils/common'

const crudRef = ref()




const options = reactive({
  id: 'backend_staff',
  rowSelection: {
    showCheckedAll: true
  },
  pk: 'id',
  operationColumn: false,
  operationColumnWidth: 160,
  formOption: {
    viewType: 'modal',
    width: 600
  },
  api: backendStaff.getList
})

const columns = reactive([
  {
    title: "主键",
    dataIndex: "id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入主键"
    }
  },
  {
    title: "创建时间",
    dataIndex: "created_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "更新时间",
    dataIndex: "updated_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "删除时间",
    dataIndex: "deleted_at",
    formType: "date",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    showTime: true
  },
  {
    title: "状态1在职2离职",
    dataIndex: "status",
    formType: "input",
    search: true
  },
  {
    title: "姓名",
    dataIndex: "name",
    formType: "input",
    search: true
  },
  {
    title: "姓名索引",
    dataIndex: "idx",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true
  },
  {
    title: "员工头像",
    dataIndex: "avatar",
    formType: "input",
    search: true
  },
  {
    title: "职位",
    dataIndex: "post",
    formType: "input",
    search: true
  },
  {
    title: "专业",
    dataIndex: "major",
    formType: "input",
    search: true
  },
  {
    title: "code",
    dataIndex: "code",
    formType: "input",
    search: true
  },
  {
    title: "联系电话",
    dataIndex: "phone",
    formType: "input",
    search: true
  },
  {
    title: "1男2女",
    dataIndex: "gender",
    formType: "input",
    search: true
  },
  {
    title: "学历",
    dataIndex: "qualification",
    formType: "input",
    search: true
  },
  {
    title: "民族",
    dataIndex: "nation",
    formType: "input",
    search: true
  },
  {
    title: "住址",
    dataIndex: "address",
    formType: "input",
    search: true
  },
  {
    title: "紧急联系人",
    dataIndex: "emergency_contact",
    formType: "input",
    search: true
  },
  {
    title: "紧急联系人关系",
    dataIndex: "emergency_contact_relation",
    formType: "input",
    search: true
  },
  {
    title: "紧急联系人电话",
    dataIndex: "emergency_contact_phone",
    formType: "input",
    search: true
  },
  {
    title: "参加工作时间",
    dataIndex: "begin_work_at",
    formType: "date",
    search: true,
    showTime: false
  },
  {
    title: "单位id",
    dataIndex: "corp_unit_id",
    formType: "input",
    search: true
  },
  {
    title: "证书",
    dataIndex: "certificate",
    formType: "input",
    hide: true
  },
  {
    title: "体检资料",
    dataIndex: "health",
    formType: "input",
    hide: true
  },
  {
    title: "教育经历",
    dataIndex: "education",
    formType: "input",
    hide: true
  },
  {
    title: "工种经历",
    dataIndex: "work",
    formType: "input",
    hide: true
  },
  {
    title: "公司id",
    dataIndex: "corp_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    commonRules: {
      required: true,
      message: "请输入公司id"
    }
  },
  {
    title: "用户id",
    dataIndex: "user_id",
    formType: "input",
    addDisplay: false,
    editDisplay: false,
    hide: true,
    commonRules: {
      required: true,
      message: "请输入用户id"
    }
  },
  {
    title: "婚配0否1是",
    dataIndex: "marry",
    formType: "input",
    search: true
  },
  {
    title: "病史0否1是",
    dataIndex: "medical_history",
    formType: "input",
    search: true
  },
  {
    title: "保险有效0否1是",
    dataIndex: "is_insure",
    formType: "input",
    search: true
  }
])
</script>
<script> export default { name: 'backend:staff' } </script>